package reflect;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        System.out.println("请输入要查询的类名：");
        String messname = scan.nextLine();

        Class clas = Class.forName(messname);
        boolean mark = clas.isAnnotationPresent(AutoRunClass.class);
        if (mark){
            System.out.println(clas.getName()+"类被标注");
        }else {
            System.out.println(clas.getName()+"类没有被标注");
        }

        /*
        Class clas1 = Class.forName("reflect.Student");
        boolean mark1 = clas1.isAnnotationPresent(AutoRunClass.class);
        if (mark1){
            System.out.println(clas1.getName()+"类被标注");
        }else {
            System.out.println(clas1.getName()+"类没有被标注");
        }

         */

    }
}
